<template>
	<div>

		<div v-for="dd in achieveList" class="listdd">
			<div style="margin-left:10px ;">
				<span> 任务Id:</span>
				<br>
				<span>{{dd.TaskId }}</span>
				<br><br>
				<span> 描述:</span>
				<br>
				<span>{{dd.Desc }}</span>
				<br><br>
				<!-- <span> 状态:</span>
				<br>
				<span>{{dd.IsAccept }}</span> -->
				<!-- <br><br> -->
				<span>提交时间:</span>
				<br>
				<span>{{dd.CreateTime }}</span>

			</div>
			<!--            <div style="margin-top: 10px;">
                <span style="margin-left:10px ;">图片展示:</span><br>
                <br>
                <img v-for="ii in dd.Images" :src="global.imageurl + ii" alt="" class="imagss"
                    @click="imagshow(global.imageurl + ii)">
            </div> -->
		</div>
		<div v-if="achieveList.length == 0">
			<h1>还未提交过</h1>
		</div>
		<!-- <ElDialog v-model="imageVisble" width="70%" style="margin-top: 20px;">
            <img :src="ImageUrl" style="width: 100%;" alt="">
        </ElDialog> -->

	</div>
</template>

<script setup lang="ts">
	import achievementapi from '@/api/achievementapi';
	import { onMounted, ref } from 'vue';
	// import global from '@/request/global';
	import { ElDialog, ElMenu } from 'element-plus';

	const props = defineProps({
		Id: Number
	})
	
	// const IsAccept = ((status: any) => {
	//     let statustext = "待接受"
	//     switch (status) {
	//         case 2:
	//             statustext = "已接受"
	//             break;
	       
	//     }
	//     return statustext
	// })
	// const imageVisble = ref(false);
	const achieveList = ref<any[]>([])
	// const ImageUrl = ref();
	const getachi = () => {
		console.log("BBB=", props.Id)
		achievementapi.get({ taskId: props.Id }).then(res => {

			res.data.forEach((element : any) => {
				achieveList.value.push({
					Desc: element.Desc,
					TaskId: element.TaskId,
					// IsAccept:element.IsAccept,
					// Images:element.Images.split(","),
					CreateTime: element.CreateTime
				})
			});
			console.log(achieveList.value)
			// achieveList.value.Images = res.data
			// var dfd:string = "dsds";
			// dfd.split(",")
		}).catch(err => {
			console.log(err)
		})
	}
	// const imagshow =(imsg :any)=>{
	//     ImageUrl.value = imsg;
	//     imageVisble.value = true
	// }
	onMounted(() => {
		getachi()
	})
</script>

<style scoped>
	.listdd {
		border-top: 1px solid rgb(119, 120, 121);

	}

	.listdd span {
		font-size: 20px;
		color: rgb(97, 95, 95);
	}

	.imagss {
		width: 100px;
		height: 100px;
		margin-left: 20px;
		cursor: pointer;
	}
</style>